import instance from './request'

//获取部门列表数据
export const getDepartmentList = () => {
  return instance.get('/company/department')
}

//获取部门负责人数据
export const getPrincipalList = () => {
  return instance.get('/sys/user/simple')
}

//新增部门
export const addDepartment = (data) => {
  return instance.post('/company/department', data)
}

//根据id获取部门详情
export const getDepartmentDetail = (id) => {
  return instance.get(`/company/department/${id}`)
}

//编辑部门
export const editDepartment = (data) => {
  return instance.put(`/company/department/${data.id}`, data)
}

//删除部门
export const deleteDepartment = (id) => {
  return instance.delete(`/company/department/${id}`)
}